function objToSelectOptionsArray(obj) {
  const arr = []
  for (const key in obj) {
    arr.push({
      label: obj[key],
      // value: Number.parseInt(key),
      value: key
    })
  }
  return arr
}

// 订单状态
export const orderStatusMap = {
  0: '待支付',
  1: '已支付',
  2: '交易关闭',
  3: '退款完成',
}
export const orderStatusOptions = objToSelectOptionsArray(orderStatusMap)

// 订单退款明细状态
export const orderRefundMap = {
  // 0: '申请退款',
  1: '退款中',
  2: '已退款',
  3: '拒绝退款',
}

// 支付类型/平台
export const payTypeMap = {
  1: '微信',
  2: '支付宝',
  3: '银联',
}
export const payTypeOptions = objToSelectOptionsArray(payTypeMap)

// 提现方式
export const withdrawMethodMap = {
  0: '对私银行',
  1: '对公银行',
  2: '支付宝',
  3: '微信',
}
export const withdrawMethodOptions = objToSelectOptionsArray(withdrawMethodMap)

// 订单类型
export const orderTypeMap = {
  0: '正常订单',
  1: '补扣订单',
}
export const orderTypeOptions = objToSelectOptionsArray(orderTypeMap)
// 订单识别
export const verifiedMap = {
  0: '未识别',
  1: '已识别',
}
export const verifiedMapOptions = objToSelectOptionsArray(verifiedMap)

// 启用禁用状态
export const enabledMap = {
  0: '禁用',
  1: '启用',
}
export const enabledOptions = objToSelectOptionsArray(enabledMap)

// 启用禁用状态
export const doorTypeMap = {
  1: '已开门',
  0: '未开门',
}
export const doorTypeOptions = objToSelectOptionsArray(doorTypeMap)

// 用户启用禁用状态
export const userEnabledMap = {
  0: '已禁用',
  1: '已启用',
}

// 运行状态
export const runStatusMap = {
  0: '离线',
  1: '在线',
}
export const runStatusOptions = objToSelectOptionsArray(runStatusMap)
// 运维状态
export const maintenanceStateMap = {
  0: '离线',
  1: '在线',
}
export const maintenanceStateOptions = objToSelectOptionsArray(maintenanceStateMap)

//商户类型
export const mctTypeMap = {
  0: '代收款',
  1: '自收款',
}
export const mctTypeMapOptions = objToSelectOptionsArray(mctTypeMap)

// 绑定状态
export const bindMap = {
  0: '未绑定',
  1: '已绑定',
}
export const bindOptions = objToSelectOptionsArray(bindMap)

// 是否标品
export const isStandardMap = {
  0: '非标品',
  1: '标品',
}
export const isStandardOptions = objToSelectOptionsArray(isStandardMap)

// 配送类型
export const tallyTypeMap = {
  0: '配送',
  1: '盘存',
}

// 财务类型
export const financeTypeMap = {
  0: '支付',
  1: '退款',
  2: '提现',
  3: '续费',
}
export const financeTypeOptions = objToSelectOptionsArray(financeTypeMap)

// 店铺分配状态
export const distributionStatusMap = {
  0: '未分配',
  1: '已分配',
}
export const distributionStatusOptions = objToSelectOptionsArray(distributionStatusMap)

// 智能方案
export const cabinetTypeMap = {
  0: '视觉',
  1: '重力',
  2: '视觉+重力',
  3: 'RFID',
}
export const cabinetTypeOptions = objToSelectOptionsArray(cabinetTypeMap)

// 提现状态
export const withdrawStatusMap = {
  0: '提现中',
  1: '成功',
  2: '失败',
}
export const withdrawStatusOptions = objToSelectOptionsArray(withdrawStatusMap)

// 广告状态
export const adsStatusMap = {
  0: '待审核',
  1: '已审核',
  2: '已审核',
}
export const adsStatusOptions = objToSelectOptionsArray(adsStatusMap)

// 广告类型
export const adsTypeStatusMap = {
  0: '图集',
  1: '视频',
}
export const adsTypeStatusOptions = objToSelectOptionsArray(adsTypeStatusMap)

// 广告审核状态
export const adsEnabledStatusMap = {
  0: '拒绝',
  1: '通过',
}
export const adsEnabledStatusOptions = objToSelectOptionsArray(adsEnabledStatusMap)

// 活动类型
export const adsMarkStatusMap = {
  1: '首单立减',
  2: '优惠折扣',
  3: '商品满减',
  4: '随机立减',
  5: '订单满减',
}
export const adsMarkStatusOptions = objToSelectOptionsArray(adsMarkStatusMap)

// 活动状态
export const adsManageStatusMap = {
  0: '禁用',
  1: '使用中',
  2: '已过期',
}
export const adsManageStatusOptions = objToSelectOptionsArray(adsManageStatusMap)

// 设备类型
export const deviceTypeMap = {
  0: '货柜app',
  1: '扫脸app',
}

// sim卡 设备类型
export const shopTypeMap = {
  0: '货柜',
  1: '扫脸',
  2: '未知',
}

// 升级状态
export const updateStatusMap = {
  0: '升级中',
  1: '已升级',
  2: '升级失败',
}

// 订单状态
export const unifiedOrderStatusMap = {
  0: '已下单',
  1: '已取消',
  2: '已结算',
  3: '已支付',
}

export const unifiedOrderStatusOptions = objToSelectOptionsArray(unifiedOrderStatusMap)

// 营销支付类型
export const marketTypeMap = {
  1: '微信',
  2: '支付宝',
}
export const marketTypeOptions = objToSelectOptionsArray(marketTypeMap)

// 是否是超管
export const isRootMap = {
  0: '否',
  1: '是',
}
export const isRootOptions = objToSelectOptionsArray(isRootMap)

// 订单阶段
export const unifiedOrderStageMap = {
  0: '待推单',
  1: '待识别',
  2: '已识别',
}
export const unifiedOrderStageOptions = objToSelectOptionsArray(unifiedOrderStageMap)
// 终端类型
export const terminalMap = {
  0: '未知',
  1: 'APP',
  2: '刷脸',
  3: '刷卡',
}
export const terminalOptions = objToSelectOptionsArray(terminalMap)

export const systemInformTypeMap = {
  1: '业务通知',
  0: '系统通知',
  2: '系统维护',
}
export const systemInformTypeOptions = objToSelectOptionsArray(systemInformTypeMap)

export const systemInformStatusMap = {
  0: '草稿',
  1: '已发布',
}
export const systemInformStatusOptions = objToSelectOptionsArray(systemInformStatusMap)

////电源状态
export const powerSupplyMap = {
  0: '电池',
  1: '市电',
}
export const powerSupplyOptions = objToSelectOptionsArray(powerSupplyMap)

//货柜异常类型
export const shopsExceptionMap = {
  0: '门锁异常',
  1: '重力传感器乱跳',
  2: '视觉摄像头异常',
  3: 'MCU异常',
  4: '库存异常',
  5: '重力传感器掉线',
  6: 'SD剩余空间不足',
  7: '售货柜不在线',
  8: '读卡器异常',
  9: '回波天线异常',
  10: '门未关',
  11: '交换机异常',
  12: '最低版本异常',
  13: '价格签异常',
  14: '摄像头盖未揭',
  15: '摄像头无图像/视频',
  16: '商品不在模版中',
  17: '摄像头异物遮挡',
  18: '供电异常',
  19: '设备离线',
  20: '其他',
  21: '订单异常',
  22: '开锁失败',
  23: '订单超时',
}
export const shopsExceptionOptions = objToSelectOptionsArray(shopsExceptionMap)

// 结算中订单审核状态
export const settlementAuditStatusMap = {
  0: '结算中',
  1: '结算完成',
}
export const settlementAuditStatusOptions = objToSelectOptionsArray(settlementAuditStatusMap)

// sim卡状态
export const simCardRevokedMap = {
  0: '正常',
  1: '作废',
}
export const simCardRevokedOptions = objToSelectOptionsArray(simCardRevokedMap)

// sim卡运营商
export const simCardOperatorMap = {
  0: '未知',
  1: '电信',
  2: '移动',
  3: '联通',
}
export const simCardOperatorOptions = objToSelectOptionsArray(simCardOperatorMap)

// 标签状态
export const labelTypeMap = {
  0: '待上架',
  1: '已上架',
  2: '已出售',
}
export const labelTypeOptions = objToSelectOptionsArray(labelTypeMap)

export const doorOrlockStatusMap = {
  0: '未知',
  1: '开',
  2: '关',
}

export const exchangerStatusMap = {
  0: '未知',
  1: '已连接',
  2: '未连接',
}

// 货柜类型
export const updateTypeMap = {
  0: '货柜app',
  7: '通用扫脸app',
  1: '微信扫脸app',
  5: '支付宝扫脸app',
  2: '运维app',
  3: '双屏异显app',
  4: '4G摄像头',
  6: '4G摄像头运维',
}
export const updateTypeOptions = objToSelectOptionsArray(updateTypeMap)
 
// 单双门
export const leftRightDoorMap = {
  0: '单控单门',
  1: '单控双门',
}
export const leftRightDoorOptions = objToSelectOptionsArray(leftRightDoorMap)

// sim卡供应商
export const simCardProviderMap = {
    0: '未知',
    1: '旭宇',
    2: 'simBoss',
    3: '叁众',
    4: '杭州施湾',
    5: '云鹰卡'
  }
export const simCardProviderOptions = objToSelectOptionsArray(simCardProviderMap)
  
// 异常等级
export const anomalyMap = {
    0: '一般',
    1: '严重',
    2: '非常严重',
  }
export const anomalyOptions = objToSelectOptionsArray(anomalyMap)

// 处理方式
export const processModeMap = {
    0: '立即',
    1: '不推送',
  }
export const processModeOptions = objToSelectOptionsArray(processModeMap)

// 业务类别
export const businessTypeMap = {
  0:'运营商',
  1:'服务商',
}
export const businessTypeMapOptions = objToSelectOptionsArray(businessTypeMap)

// 使用状态
export const tradingMap = {
  0:'否',
  1:'是',
}
export const tradingMapOptions = objToSelectOptionsArray(tradingMap)

// 货箱类型
export const bin_typeMap = {
  0:'单控单门',
  1:'单控双门',
}
export const bin_typeMapOptions = objToSelectOptionsArray(bin_typeMap)

// 0:未知 1开 2关
export const lockMap = {
  0:'未知',
  1:'开',
  2:'关',
}
export const lockMapOptions = objToSelectOptionsArray(lockMap)


// 交换机状态
export const exchangerMap = {
  0:'未知',
  1:'已连接',
  2:'未连接',
}
export const exchangerMapOptions = objToSelectOptionsArray(exchangerMap)

// 在线状态
export const net_stateMap = {
  0:'离线',
  1:'在线',
}
export const net_stateMapOptions = objToSelectOptionsArray(net_stateMap)

// 是否支持电子温控
export const has_ectMap = {
  0:'否',
  1:'是',
}
export const has_ectMapOptions = objToSelectOptionsArray(has_ectMap)

// 标准温度
export const standard_temperatureMap = {
  2:'2° ~ 6°',
  3:'3° ~ 7°',
  4:'4° ~ 8°',
  5:'5° ~ 9°',
  6:'6° ~ 10°',
}
export const standard_temperatureMapOptions = objToSelectOptionsArray(standard_temperatureMap)

// 温度传感器状态
export const temp_statusMap = {
  0:'异常',
  1:'正常',
}
export const temp_statusMapOptions = objToSelectOptionsArray(temp_statusMap)

// 化霜传感器状态
export const defrost_statusMap = {
  0:'异常',
  1:'正常',
}
export const defrost_statusMapOptions = objToSelectOptionsArray(defrost_statusMap)

// 货柜的制冷状态
export const refrigeration_statusMap = {
  0:'制冷关',
  1:'制冷开(恒温)',
  2:'制冷开(制冷)',
  3:'制冷开(化霜)',
}
export const refrigeration_statusMapOptions = objToSelectOptionsArray(refrigeration_statusMap)


// 货柜状态
export const cabinet_statusMap = {
  0:'绑定',
  1:'解绑',
}
export const cabinet_statusOptions = objToSelectOptionsArray(cabinet_statusMap)
// 柜门
export const door_statusMap = {
  0:'单开门',
  1:'双开门',
}
export const door_statusOptions = objToSelectOptionsArray(door_statusMap)

export const door_statusMap2 = {
  0:'单开门',
  1:'双开门',
}
